/******************************************************************************
 ** Name: traits.cpp                                                            **
 ** Description:                                                              **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved 2-clause BSD License                             **
 **                                                                           **
 **  Copyright (c) 2009-2010 Barry "Gian" James  <bjames@munixos.net>         **
 **  All rights reserved.                                                     **
 **                                                                           **
 **  Redistribution and use in source and binary forms, with or without       **
 **  modification, are permitted provided that the following conditions are   **
 **  met:                                                                     **
 **                                                                           **
 **  * Redistributions of source code must retain the above copyright notice, **
 **    this list of conditions and the following disclaimer.                  **
 **  * Redistributions in binary form must reproduce the above copyright      **
 **    notice, this list of conditions and the following disclaimer in the    **
 **    documentation and/or other materials provided with the distribution.   **
 **                                                                           **
 **  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      **
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED **
 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           **
 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT        **
 ** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    **
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED  **
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR    **
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    **
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      **
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        **
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              **
 **                                                                           **
 ******************************************************************************/
// Modified $Date: 2011-11-24 00:07:02 -0700 (Thu, 24 Nov 2011) $ by $Author: unknown $
#define _traits_cpp_ID    "$Id: traits.cpp 63608 2011-11-24 07:07:02Z unknown $"



#define TRAITW(DESC,ABBR) {  #DESC,  #ABBR, TRAIT_WPN_ ## ABBR }
#define TRAITV(DESC,ABBR) {  #DESC,  #ABBR, TRAIT_VCL_ ## ABBR }

#include "traits.hpp"

TraitString
Trait::traitStrings[] =
{
    {"<unknown>", "<UNK>", TRAIT_NONE },
    TRAITW(Armor Piercing,AP),
    TRAITW(Balanced,BAL),
    TRAITW(Damage Reduction,DR),
    TRAITW(Dependable,DEP),
    TRAITW(Durable,DUR),
    TRAITW(Extended Range,ER),
    TRAITW(Fast Reload,FRL),
	TRAITW(Flammable, FLA),
	TRAITW(Frangible, FRA),
	TRAITW(Guided, GUI),
	TRAITW(Long Range, LR),
	TRAITW(Night Vision, NV),
	TRAITW(TODO TODO, OBA),
	TRAITW(Reliable, REL),
	TRAITW(Short Range, SR),
	TRAITW(Slow Reload, SRL),
	TRAITW(TODO TODO, SPL),
	TRAITW(TODO TODO, VOL),
	TRAITW(TODO TODO, URL),
	TRAITW(Upgradable, UPG),
	TRAITW(Accurate, ACC),
	TRAITW(Imprecise, IMP),
	TRAITW(Bulky, BLK),
	TRAITW(Discreet, DIS),
	TRAITW(Suppressed, SUP),
	TRAITW(Noisy, NSY),
	TRAITW(Threaded Barrel, THB),
	TRAITW(Composite, CMP),

    {NULL,NULL,TRAIT_NONE}
};

std::string
Trait::TraitToStr(int t)
{
    std::string    tstr(traitStrings[t].name);

    return tstr;
}
std::string
Trait::TraitToStrAbbr(int t)
{
    std::string    tstr(traitStrings[t].abbr);

    return tstr;
}

Trait::Trait(std::string d, TraitType tt, int t)
{
    traits = t;
    desc = d;
    type = tt;
}

Trait::Trait()
{
    traits = TRAIT_NONE;
    type = TraitType::max;
}


Trait::~Trait()
{
}

